package org.example.system.controller;

import org.example.common.base.util.web.AjaxResult;
import org.example.common.security.annotation.RequiresPermissions;
import org.example.system.service.ISysResourceService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 菜单管理 前端控制器
 * </p>
 *
 * @author LiJunYi
 * @since 2020-05-25
 */
@RestController
@RequestMapping("/sys/resource")
public class SysResourceController
{
    private final ISysResourceService resourceService;


    public SysResourceController(ISysResourceService resourceService) {
        this.resourceService = resourceService;
    }

    @RequiresPermissions("sys:resource:view")
    @GetMapping("list")
    public AjaxResult list()
    {
        return AjaxResult.success(resourceService.list());
    }
}

